import java.util.Random;
import java.util.Scanner;

public class GuessNum {
    public static void main(String[] args) {
        Scanner scanner1 = new Scanner(System.in);
        //多组输入
        /*while(scanner1.hasNextInt()) {
            int n = scanner1.nextInt();
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if(i==j || i+j == n-1) {
                        System.out.println("*");
                    } else {
                        System.out.println(" ");
                    }
                    System.out.println();
                }
            }
        }*/
        //猜数字游戏
        Random random = new Random();//生成随机数
        int num = random.nextInt(100)+1;//生成1-100的随机数
        while(true) {
            Scanner scanner = new Scanner(System.in);
            //输入猜的数字
            System.out.println("请输入要猜的数字:");
            int guess = scanner.nextInt();
            if (guess > num) {
                System.out.println("猜大了");
            } else if (guess < num) {
                System.out.println("猜小了");
            } else {
                System.out.println("猜对了");
                break;
            }
        }
    }
}
